{include file="public/header" /}
<title>{:lang('设置')}</title>
<header id="header" class="mui-bar mui-bar-nav">
    <div class="mui-pull-left PopupNavigation">
        <img src="/static/home/bl_1.png" alt="">
    </div>
    <h1 class="mui-title">{:lang('设置')}</h1>
    <div class="mui-pull-right" style="display: none;">
        <div class="mui-switch mui-active" >
            <div class="mui-switch-handle"></div>
        </div>
    </div>
</header>    
{include file="public/menu" /}
<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
    <div class="mui-scroll">
        <div class="returnpushBox" style="border-bottom:1px solid #eeeeee;">
            <button class="returnpushan mui-action-back">{:lang('关闭')}</button>
        </div>
        <form id="subForm">
            <div class="gistememBox">
                <div class="gistememinput df" style="display: none;">
                    <div class="gistememinputtl">{:lang('姓名')}:</div>
                    <div class="fx1">
                        <input type="text" name="username" value="{$user['nickname']}"  autocomplete="off" class="gisteinput" placeholder="{:lang('请输入姓名')}">
                    </div>
                </div>
                <div class="gistememinput df">
                    <div class="gistememinputtl">{:lang('账号')}:</div>
                    <div class="fx1">
                        <input type="number" name="username" disabled value="{$user['username']}" autocomplete="off" class="gisteinput" placeholder="{:lang('请输入手机号')}">
                    </div>
                </div>
                <div class="gistememinput df" style="display: none;">
                    <div class="gistememinputtl">{:lang('手机号')}:</div>
                    <div class="fx1">
                        <input type="number" name="mobile" value="{$user['mobile']}" autocomplete="off" class="gisteinput" placeholder="{:lang('请输入手机号')}">
                    </div>
                </div>
                <div class="gistememinput df" style="margin-bottom:20px;">
                    <div class="gistememinputtl">{:lang('推荐人')}:</div>
                    <div class="fx1">
                        <input type="text" disabled value="{$user['parent_name']}" class="gisteinput" placeholder="{:lang('请输入推荐人账号')}">
                    </div>
                </div>
            </div>
            <div class="gistememBox">
                <div class="gistememinput df">
                    <div class="gistememinputtl">{:lang('身份证号')}:</div>
                    <div class="fx1">
                        <input type="text" name="card" value="{$bank.card}" autocomplete="off" class="gisteinput" placeholder="{:lang('请输入身份证号')}">
                    </div>
                </div>
                <div class="gistememinput df">
                    <div class="gistememinputtl">{:lang('开户行')}:</div>
                    <div class="fx1">
                        <select name="khh" class="gisteinput">
                            <option value="">--{:lang('请选择开户行')}--</option>
                            {foreach :config('base.bank') as $k=>$v}
                            <option  value="{$k}" {if condition="$bank.khh eq $k"}selected{/if}>{$v}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="gistememinput df">
                    <div class="gistememinputtl">{:lang('开户人姓名')}:</div>
                    <div class="fx1">
                        <input type="text" name="name" value="{$bank.name}" autocomplete="off" class="gisteinput" placeholder="{:lang('请输入银行开户名')}">
                    </div>
                </div>
                <div class="gistememinput df">
                    <div class="gistememinputtl">{:lang('银行卡号')}:</div>
                    <div class="fx1">
                        <input type="number" name="bank" value="{$bank.bank}" autocomplete="off" class="gisteinput" placeholder="{:lang('请输入银行卡号')}">
                    </div>
                </div>

            </div>

            <div class="gistememBox">
                <div class="gistememinput df" style="display: none;">
                    <div class="gistememinputtl">{:lang('二级密码')}:</div>
                    <div class="fx1">
                        <input type="number" id="token" name="token" value="" autocomplete="off" class="gisteinput" placeholder="{:lang('请输入二级密码')}">
                    </div>
                </div>

                <div class="applicaageAnbox">
                    <button class="applicaageAn subForm" type="button">{:lang('提交')}</button>
                </div>
            </div>
        </form>
    </div>
</div>
{include file="public/footer" /}

<script>

    mui('.mui-scroll-wrapper').scroll({
        deceleration: 0.0005
    });
    var mask=mui.createMask(),isSub = true;
    mui('body').on('tap', '.subForm', function() {
        var obj = $(this);
        if(isSub) {
            isSub = false;
            var data = $('#subForm').serialize();
            var url = "{:url('editData')}";
            mui.showLoading("提交中","div");
            document.activeElement.blur();
            $("#token").val('');
            mask.show();//显示遮罩层
            $.post(url, data, function(data) {
                mask.close();//关闭遮罩层
                mui.hideLoading();
                if(data.status == 0) {
                    isSub = true;
                    mui.toast(data.msg, {
                        duration: 'long',
                        type: 'div'
                    });
                } else if(data.status == 1) {
                    mui.toast(data.msg, {
                        duration: '2000',
                        type: 'div'
                    });
                    setTimeout(function() {
                        window.location.href = data.url;
                    }, 2000);
                }
            });
        }
    });
</script>
</body>

</html>